package com.sali.asyncollection.service.impl.strategy.method5;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @description:  @Async 注解不能有返回值，且无法被事务控制
 * @author: sali
 * @date: 2024/7/21 下午3:41.
 * @version: 1.0
 */
@Service
@Slf4j
public class AsynMethod05 {

    @Async
    public  void sendMessage(Long userId){
        log.info("发消息订单下单成功，用户是：{}", userId);
    }

    @Async("taskExecutor2")
    public  void socreGet(Long userId){
        log.info("赠送积分成功，用户是：{}", userId);
    }

}
